package com.imooc.springcloud;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @describte:测试负载均衡
 * @program:spring-cloud-demo
 * @author:zhengdp
 * @create:2021-10-01 11:31:28
 **/
@RestController
public class Controller {


    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("sayHi")
    public String sayHi(){
        return restTemplate.getForObject(
                "http://eureka-client/sayHi",
                String.class
        );
    }
}
